Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Update Data Card with variable

Posted on by 27

Power Apps Newbie here🙄, I appreciate your help.

 

My data card is connected to a field called IsManual that will accept N/A, Yes, or No. I want to use one of three buttons that function like option buttons instead of a dropdown list. 

 

The data source is a SharePoint list with items from a variable with defaults, e.g., Set(varFormData, Defaults('My List')). All my other screens with regular data cards work fine.

 

clight_0-1677274535282.png

 

Screen OnVisible = Set(varButtonValue1,"")

btnNA OnSelect= If(varButtonValue1 = "N/A", Set(varButtonValue1,""), Set(varButtonValue1,"N/A"))

btnYes OnSelect= If(varButtonValue1 = "Yes", Set(varButtonValue1,""), Set(varButtonValue1,"Yes"))

btnNo OnSelect= If(varButtonValue1 = "No", Set(varButtonValue1,""), Set(varButtonValue1,"No"))

All the above work fine. The correct value is stored in the varButtonValue1 variable.

 

How do I update the data card (connected to varFormData) to accept varButtonValue1 as the value for the field IsManual? I am  patching to SharePoint later in the app.

 

I get an error when I put varButtonValue1 in the data card Updates box.

clight_0-1677275958897.png

 

 

I get an error with varButtonValue1 in the dropdown list, which I was going to hide and use as the Update property on data card.

clight_1-1677275483759.png

 

  • clight Profile Picture
    clight 27 on at
    Re: Update Data Card with variable

    @WarrenBelz  Worked like a charm!  Thank You😀

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 142,733 on at
    Re: Update Data Card with variable

    Hi @clight ,

    Just use one code on the three OnSelect

    UpdateContext({varButton1: Self.Text})

    At Screen OnVisible

    UpdateContext({varButton1: ThisItem.IsManual.Value})

    then the Update of the Data Card (assuming you are writing back to a Single Choice field)

    {Value: varButton1}

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,733

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,750

Leaderboard