cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
therush321
Helper II
Helper II

How do I update a free text field with a button

Hi All

 

I am trying to update a field item based off a Button.

 

I would have 2 buttons called: Approve and Reject.

 

Each button would need to update the field value: Approved Status based on the selection.

 

I have tried using variables to update my field but no luck.

 

My source is a SharePoint list.

1.PNG2.PNG

Default.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

@therush321 ,

The error is ‘Approved StatusDataCard1’ not being recognised. That sounds like the card, not the text box. This will be called DataCardValuexx ( xx a number).

 

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.

View solution in original post

15 REPLIES 15
WarrenBelz
Super User
Super User

Hi @therush321 ,

There are a couple.of ways to approach this, but I will run with simply filling in the text box for you to save later. Using the Approve Button, put this on the OnSelect

 

UpdateContext({varStatus:"Approved"});
Reset(YourStatusBoxName)

 

and obviously use Rejected for the other button.

Now the Default of the Status box 

 

If(
   !IsBlank(varStatus),
   varStatus,
   Parent.Default
)

 

and finally add to any save or screen exit code

 

UpdateContext({varStatus:Blank()})

 

 

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.

 

@WarrenBelz Thank you very much for your help.

 

I am almost there. I managed to get the button to display it if it is approved or rejected but it is not saving the data and reflecting it as such.

Hi @therush321 ,

What is the Update property of the DataCard the status box is in?

@WarrenBelz it is set to the variable: varStatus

@therush321 ,

It needs to be

YourTextBoxName.Text

You have already set the value of the text - you just need to write it to the list.

 

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.

@WarrenBelz 

 

I have tried that but it is giving me an error message.

 

Sorry for I am new to this.

therush321_0-1602667742694.png

 

Hi @therush321 

 

Screen -> OnVisible -> Set(SelectedStatus,"");

 

Approve Button -> OnSelect -> Set(SelectedStatus,"Approve");

 

Reject Button -> OnSelect -> Set(SelectedStatus,"Reject");

 

TextInput to show value -> Default -> Coalesce(SelectedStatus, Parent.Default)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

@yashag2255 Thank you for your suggestion but it only works to display the text. I need it to save it.

I tried adding a submit form code to the button but it only works off once.

 

Set(SelectedStatus;"Approved") & SubmitForm(EditForm1)

@therush321 ,

The error is ‘Approved StatusDataCard1’ not being recognised. That sounds like the card, not the text box. This will be called DataCardValuexx ( xx a number).

 

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.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,425)