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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formula so a form item...
Power Apps
Unanswered

Formula so a form item sets to either the item opened from SharePoint List OR the item selected from a gallery in the app?

(0) ShareShare
ReportReport
Posted on by

Hi there,

 

I am building an app for 'internal audits' connected to a single SharePoint List. 

One item on the list = one audit record.

The list supports four types of audits using content types. 

 

So far, the app consists of:

  • one 'gallery page' (to view all existing items, use filters to find them, select the one you want)
  • one 'set up page' to complete/edit a form applicable to all audit records
  • four audit pages, one applicable to each type of supported audit 

My question is: how do I get the form on the set up page to open the correct item whether the use has chosen to create a new item from SharePoint, edit an existing item from SharePoint or edit an existing item by selecting it from the gallery page gallery? 

 

App: On start: Set(SELECTED_AUDIT_ID,SharePointIntegration.Selected.ID)

Gallery screen: select arrow: OnSelect: Set(SELECTED_EXISTING_AUDIT, Label_ID_Hidden); Navigate(Welcome_Screen)
SharePoint integration: OnNew: Set(SharePointFormMode, "CreateForm"); NewForm(Form_1); Navigate(Welcome_Screen, ScreenTransition.None)
SharePoint integration: OnEdit: Set(SharePointFormMode, "EditForm"); EditForm(Form_1); Navigate(Welcome_Screen, ScreenTransition.None)

 

Set Up Screen: Form_1: Item:  ???

  • To see the first item in the list First('Internal Audits')
  • To use the item the user opened from SP: SharePointIntegration.Selected
  • To open a blank form and create a new item: Defaults('Internal Audits')
  • To edit the item selected from the gallery: ?? SELECTED_EXISTING_AUDIT (this is a List item ID number)??
  • Logic to combine the three? ??

 

Thoughts?

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @Anonymous ,

    The Item of your Form is

    LookUp(
     YourListName,
     ID=SELECTED_AUDIT_ID
    )

    or simply

    LookUp(
     YourListName,
     ID=SharePointIntegration.SelectedListItemID
    )

    If selected from a Gallery (I cannot see your model)

    Lookup(
     YourListName,
     ID=GalleryName.Selected.ID
    )

    I am not sure why you have all the complexity with the Variables.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard