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 / 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 Microsoft Employee

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
    156,100 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

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard