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
Unanswered

Edit selected item

(0) ShareShare
ReportReport
Posted on by 80

Hi,

My App starts with a NewForm screen where users can add new items to a sharepoint list.

On the second screen I've added a DataTable to show the items the user has added.

Now I want that the user can select one of his item and edit them again in the previous NewForm screen.

I've added an "Edit" button with the OnSelect Property: Navigate(NewEntry, None, {selectedID: DataTable1.Selected.ID})

But then on the NewForm it says "No item to display".

Can someone help me out? thanks

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    First of all galleries are better to manage and have more function when it comes to displaying the data.

    On your button that navigates to your form write this:

    Set(selectedID,DataTable1.Selected.ID); Navigate(NewEntry);

     

    In the Form's item property write this:

    LookUp(ListName,ID=selectedID);

     

    This way your form knows what to display

  • buzzen Profile Picture
    80 on at

    Thanks...

    I've implemented as you wrote but the record is not loaded at all....

    Within the Navigate function I need to set the Screen not the Form right?

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    a12.jpga14.jpg

  • buzzen Profile Picture
    80 on at

    First I thought it's because in my DataTable I've added more fields than in the NewForm... so I removed the unnecessary ones... but it's still not working... so I tried it with the Title instead of the ID.... but still no luck:

    buzzen_0-1631781564763.pngbuzzen_1-1631781648625.png

     

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    It will only work with ID and no other column. As you can see from my previous reply i tested the same thing and it's working fine. Let's do some debugging.

    Insert a label. Set It's text property to your variable that variable which stores the id. in my case it was varItem.

    Remove the navigate code from edit button. click on edit button. Check if you are getting id on that label.

  • buzzen Profile Picture
    80 on at

    Okay, yes the setVar function seems to work... I can select an item > click on Edit > the label shows the ID.

    In the NewForm when I there set directly an ID like: LookUp('AO PoC',ID="23") i can see the record. But the Form shows a warning: Incompatible types for comparison. These types can't be compared: Number, Text.

    Now I somehow need to figure out which field's affected....

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    LookUp('AO PoC',ID=23)

     

    if you use double inverted comma it is a string. And your id column is always number. remove the inverted comma like above.

  • buzzen Profile Picture
    80 on at

    I've now added a new EditForm in a new blank Screen and set the Item Property to our Lookup value... And it shows the record correctly... looks like I customized too many fields in my initial "EditForm". But have now idea yet what I need to change....

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    As i showed, you don't need much to edit a record. Just the id in the variable and Item code of form. Most probably your form mode was messing with your code. It's not worth to find the bug when it can be solved by adding new form.

  • buzzen Profile Picture
    80 on at

    The thing is I need the form the way I customized it... And I found out in the meantime. e.g. the "Type fo Archive item" field is when you newly add it's a dropdown menu. And I needed to change that to RadioButtons... So the lookup value has problems with auto-fill this RadioButtons. All other fields are filled-out correctly...

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard