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 Platform Community / Forums / Power Apps / Gallery and Form tied ...
Power Apps
Answered

Gallery and Form tied to Collection as datasource, having trouble updating records

(0) ShareShare
ReportReport
Posted on by 4

Currently I have a Form for entering 'line items', Submit button to Collect it to the same collection, and then a Gallery to Display said collection. This is eventually Patched to SQL later in my app, however I'm having trouble editing records since I don't have a unique key in a collection.

Essentially the Form is pointing to the Collection colLineItems. Since it's not a true datasource, all of my cards are custom cards, and my submit button simply collects the values of each text box, resets the form, sets it as a New form, and sets my LineItemSelected variable to Blank(). (That variable is populated with the selected item from the Gallery)

 

The Gallery is pointing to the same Collection, however if a user wanted to edit one of those records, my collection data is too dynamic to have a unique key. I was looking into including an incremental Sequence number an a sort of temporary key, however there's a chance that those wouldn't be unique either since costs and quantities are two of my Form fields.

Any ideas? I know this is an atypical use of a collection in a Form, but surely someone has tried to create something similar to this. I'm just not sure what the best way to go about it is.

Thanks in advance!

I have the same question (0)
  • Verified answer
    v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @Stoikryz ,

     

    If the incremental sequence number may also be duplicated and make it unusable, maybe you can consider using the GUID function.

    https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-guid#syntax

     

    In addition, maybe you could generate a unique ID based on the current date & time(yyyymmddhhmmss)

    Text(Now(),"yyyymmddhhmmss")

     

    Best Regards,
    Charlie Choi

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard