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 / Approval based on Gall...
Power Apps
Answered

Approval based on Gallery Selected

(0) ShareShare
ReportReport
Posted on by 40

Hello Community,

 

Seek your advise and help for below case that I struggle within.

 

So, I have 2 Data Sources (SharePoint) as shown below

1. ascis pr tracking

2. item list

 

Am4ree_1-1658987885202.png

 

Gallery1_2 with ascis pr tacking and filtered only show up state "Submitted".

Gallery 5_2 with item list.

 

Currently wherever Icon > clicked on gallery 1_2,  Item list will show up based on Gallery1_2 selected.

 

Goals.

I put 2 Icons on the top of the corner, Icon_Approve and Icon_Reject.

I want to achieved approval based on Gallery 1_2 Selected and patch column state in ascis pr tracking from "submitted"  to "approved by manager" as I have defined choices on the sharepoint list. Once state changed to "Approved by Manager", the list selected automatically disappears from Gallery1_2.

 

Same also with Icon_Reject, once icon_reject clicked, the state will change to "Rejected by Manager" and the list selected will disappear on Gallery1_2 

 

Am4ree_2-1658988317839.png

 

Appreciated if anyone can advise me with this case.

 

Thank You.

 

Categories:
I have the same question (0)
  • AJ_vizMan Profile Picture
    on at

    Hi @Am4ree  - Please refer this thread where lookup column is not recommended to use (Depends on use of solution and other factors)

    Solved: How to update a lookup field in SharePoint List - Power Platform Community (microsoft.com)

     

    One way to achieve is by using Power Automate -
    take a look here Update SharePoint column only if there's a value using Power Automate (tomriha.com)

     

    You can use trigger ' When an item is created or Updated' in SharePoint list1 and than use the conditions accordingly to update value in List 2

     

    Let me know if, i can further help you on this

  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Am4ree ,

     

    Your said your first gallery is filtered on "State = Submitted".

     

    If you change the value of "State" to "Approved" or "Rejected", it will no longer be equal to "Submitted" which explains why the record isn't displayed anymore in your gallery.

  • Am4ree Profile Picture
    40 on at

    Hi @AJ_vizMan ,

     

    I just only need update one record on SP list 1 "ascis pr tracking". state column is one of column from "ascis pr tracking".  I thought that is possible with defined variable and patch it to SP, However Thank you and let me try your advise with automate,

  • Am4ree Profile Picture
    40 on at

    Hi @WiZey ,

     

    Yes Correct, Gallery1_2 (First Gallery) filtered only "State = Submitted".

    And it should be disappear after State changed " Approved" or 'Rejected'.

    but I still struggle to update the "state = submitted" to "approved" based on gallery1_2 (First Gallery) selected.

  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    If you want to update a record in a SharePoint list, you can use either "Patch()", "Update()" or "UpdateIf()".

     

    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-patch

    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-update-updateif

     

    With "Patch()" it would be something like this (note that "Update()" follow the same pattern):

     

    Patch(
     source,
     Gallery.Selected,
     {value: {Value:newValue}}
    )

     

    With "UpdateIf()" it should look like this:

     

    UpdateIf(
     source,
     ID = Gallery.Selected.ID,
     {value: {Value:newValue}}
    )

     

    Hope this was helpful to you.

  • Am4ree Profile Picture
    40 on at

    Hi @WiZey 

     

    Thank you & let me try your advise.

     

    Hopefully it will work.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard