web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Collect Function

(0) ShareShare
ReportReport
Posted on by 20

Hi all

 

I'm sure someone will have a quick answer 🙂
I'm scratching my head at the moment and can't work out why I are getting the error.

 

I have the following code, however its giving me an error and I cant work out why!
It broke when I added the additional table Item "Time"

 

 

Collect(TimeEstimate, {Item:Label1_1.Text, Time:Label2.Text}) ; Navigate(NetworkScreen)

 

 

Capture.PNG

 

Thanks

Categories:
  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @PowerAppsNoob1 ,

     

    Time is a keyword try the same as below:

    Collect(TimeEstimate, {Item:Label1_1.Text, TimeVal:text(Label2.Text)}) ; Navigate(NetworkScreen)

     
    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • PowerAppsNoob1 Profile Picture
    20 on at

    Thank you for your help, you may be able to help me with another quick one, 

    I am trying to add up the TimeVal collection total into a text label.


    Any idea's? - Basically I am after a total time box once all items have been added to the collection and show in the gallery.

  • KrishnaV Profile Picture
    5,023 on at

    Hi @PowerAppsNoob1 ,

    try this:

    updateContext({varsumvalue:Sum(collectioname,TimeVal)})

    Now set the varsumvalue to a label.

     

    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • PowerAppsNoob1 Profile Picture
    20 on at

    Hi @KrishnaV 

     

    Thankyou for your reply, but where am I entered the code 

    updateContext({varsumvalue:Sum(collectioname,TimeVal)})

    If I entered it on the textLabel I just get an error? 

  • Verified answer
    PowerAppsNoob1 Profile Picture
    20 on at

    I have solved it with this line of code 🙂

     

    Sum(TimeEstimate, TimeVal)
  • Tapesh Profile Picture
    825 on at

    Hi @KrishnaV  and @PowerAppsNoob1  is there a way to sort the collection using the sort function in ascending order?

    please find the code below, 

    ForAll( 
     Gallery4.AllItems,
     Collect( 
     ExportColGal4, 
     {
     
     Column1: Text(Gal4ACustId.Text),
     Column2: "I",
     Column3: 501,
     Column4: 10, 
     Column5: 2020,
     Column6: "",
     Column7: Gal4Description.Text,
     Column8: Gal4Created.Text,//should be in format of dd-mm-yyyy
     Column9: Gal4GLcode.Text,//this should be the GL code
     Column10: ""
    }
    )
    )


    Thanks in advance for the help. 

     

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Tapesh ,

     

    This is a closed thread I would advise you to open a new thread to help you better.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard