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 / Update Text Field from...
Power Apps
Answered

Update Text Field from Gallery Button

(0) ShareShare
ReportReport
Posted on by

I would like to update the text field "PO Number" with the "PO#" in the item selected in the in the gallery when the arrow button is clicked.  How do I do this?

cmegow_0-1600923605243.png

 

Please provide formula for Text Field "PO Number" and Formula for OnSelect for the Button.

 

Both fields are Single Line of Text Fields.

 

Thank you for your help!!!

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @cmegow :

    Could you tell me :

    • Do you want to use the Gallery.selected.'Po Number' to replace the text fo the label control?

    1.jpg

    If so,there is no need to modify the button's OnSelelct property .

    Plese just set the lable contrl's Text property to:

     

    Gallery.selected.'Po Number' /*Gallery is the name of your gallery*//*'Po Number' is a field of the gallery's datasource*/

     

    If there is any error in my understanding, please help me to point it out.I hope this can help you.

    Best Regards.

    Bof

     

  • cmegow Profile Picture
    on at

    @v-bofeng-msft thank you for the help.  Here's the result:

     

    I changed the button in my Gallery OnSelect formula back to Select(Parent)

    I replaced the Text input field in the Purchase_Order_Number_DataCard1 with a label (Label1).

    I updated the Text formula for Label1 to be Gallery4.Selected.'PO Number' 

    I double checked my gallery datasource and it is pulling from 'FPC-Purchase Orders' and the reference to 'PO Number' is correct

    I updated the the Update formula for Purchase_Order_Number_DataCard1 to be Label1.Text

     

    I am getting the following error on Label1:

    Issue

    This rule creates a circular reference between properties, which is not allowed.  A property cannot refence itself or other properties affected by its value.

    Location:

    Label1.text

     

    I am getting the following error on Purchase Order Number_DataCard1:

    Issue

    This rule creates a circular reference between properties, which is not allowed.  A property cannot refence itself or other properties affected by its value.

    Location:

    Purchase Order Number_DataCard1.Update

     

    I thought I may have accidently used the 'Purchase Order Number' field in my 'FPC-Invoice' list on accident somewhere, but I've checked everywhere I know to look.  All references are linked to my 'FPC-Purchase Order List' and the 'PO Number'.  My gallery is filter by columns from my 'FPC Invoices' list 'School' and 'Vendor Name'.  Could that be the problem?

     

    Thank you for the assistance.

     
     

     

     

     

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @cmegow :

    Because the error prompts "circular reference",the cause of "circular reference is "refer to itself or other attributes affected by its value", please check from this aspect.

    This should be related to the Items property of the Form or the Gallery.(If you can't find the problem by yourself, could you tell me what the items property of this form and gallery are?)

    I hope this can help you.

    Best Regards,

    Bof

     

  • cmegow Profile Picture
    on at

    Ok, I totally trashed the app and started over.  I went through all the steps to get it all set back up and I get the same circular reference error.

     

    Here is the item property of Gallery2

     

    Filter('FPC-Purchase Orders', School = DataCardValue10.Selected.Result And 'Vendor Name' = DataCardValue11.Selected.Result)

     

    DataCard10 item property is 

     

    SortByColumns(Distinct('FPC-Purchase Orders'.School,School),"Result")

     

    DataCard11 item property is 

     

    SortByColumns(Distinct(Filter('FPC-Purchase Orders',School = DataCardValue10.Selected.Result),'Vendor Name'),"Result")

     

    Here is the item property of SharePointForm1

     

    If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@'FPC-Invoices']),SharePointIntegration.Selected)

     

    I really don't get the circular reference.  my gallery and all of the filtering on it are from the FPC-Purchase Order List.

     

    Thanks for trying to help @v-bofeng-msft I really appreciate you.

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @cmegow :

    Could you tell me what SharePointIntegration is?Is it Gallery2?

    There are 4 controls in your description:

    • DataCard10
    • DataCard11
    • DataCardValue10
    • DataCardValue11

    Are they two data cards and two controls in the data card?

    Best Regards,

    Bof

  • cmegow Profile Picture
    on at

    @v-bofeng-msft I'm honestly not sure what Sharepoint Integration is.  Other than the reference in the item property of my form, I only see it in one other place.  It's at the top of my tree view, but there are no controls to it.  Here is my tree view with only the fields that are giving me trouble expanded.  I hope this clears is up!

     

    cmegow_0-1601474772057.png

    cmegow_1-1601474816262.png

     

  • cmegow Profile Picture
    on at

    @v-bofeng-msft Sharepoint Integration DataSource is [@'FPC-Invoices']

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @cmegow :

    I think I probably understand what is going on. I discovered that your app is a custom from in SharePoint.Because there are too many controls involved and the connection between controls is little complicated, it is difficult for me to find the reason for the circular reference in a short time.

    Let's change the way,I suggest you try to use variables to weaken the mutual references between various controls:
    1\Set the button's OnSelect proeprty to

    Set(TheVar,ThisItem.PO Number')

    2\Set Label1's Text property tp

    TheVar

    Best Regards,

    Bof

  • cmegow Profile Picture
    on at

    That worked for my PO Number.  Thank you!  Now, I added And Set(TheVar2, ThisItem.'Funding Source') And Set(TheVar3, ThisItem.'Project Name')  The variable worked on the PO Number and Funding Source because those are both single line of text columns in my datasource.  But, the Project Number is a lookup column from another list.  So, TheVar3 returns and error as follows:

     

    Issue

     

    Expected Text value.

     

    The property on this control expects Text values.  The rule produces Record values which are incompatible.

     

    How to fix

     

    Change the rule to produce a {0} Value

  • cmegow Profile Picture
    on at

    UpdateContext({TheVar3: ThisItem.'Project Name'.Value})

     

    This formula did the trick for the lookup field.

     

    This app is DONE!

     

    Thank you for all your help @v-bofeng-msft 

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard