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 / check the ThisItem.Amo...
Power Apps
Unanswered

check the ThisItem.Amount is inside the Radio button Items

(0) ShareShare
ReportReport
Posted on by 3,514

I have the following Card, which contain a Radio button with static Items + a free text to enter user defined value:-

 

3arrows.png

 

this represents a choice field inside SharePoint which allow fill-in values:-

 

aloow fill in.png

 

now when we are editing an item, how i can check if the ThisItem.Amount is inside the Radio button Static Items? can anyone help me with the formula please?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @johnjohn123 

    As mentioned in your other post, you have the potential for multiple values that are not in the choices - which one do you want to display?

  • johnjohn123 Profile Picture
    3,514 on at

    @RandyHayes  but i mentioned to you that this will never happen......please read my post

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @johnjohn123 

    I understand what you are saying.

     

    If you're hard coding it, the you will need to do so in the Default property of your TextInput as well.

    If(!(ThisItem.Amount.Value in ["$5", "$10"...]), ThisItem.Amount.Value)

     

  • johnjohn123 Profile Picture
    3,514 on at

    @RandyHayes  of course i know how to hard code the formula,,, my question is about doing this dynamically,, so if new static item is added to the Radio button's Items the formula will keep working as is.. Thanks

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @johnjohn123 

    Yes, if you alter the Items property of the Radio control from what you've shown, then you would need to update the formula on the Default property.

     

    Alternatively, you can just use a variable.

    In your OnStart:  Set(glbAmounts, ["$5", "$10", ... ] )

    Then set your Radio Items property to: glbAmounts

    And set your Default property on the TextInput to: 

    If(!(ThisItem.Amount.Value in glbAmounts), ThisItem.Amount.Value)
  • johnjohn123 Profile Picture
    3,514 on at

    @RandyHayes  but i DO NOT WANT TO WRITE STATIC CODE INSIDE MY FORMULAS..... I KNOW HOW TO DO IT

     

    I am asking this question if there is a way to dynamically get the static choices inside the radio button.. i am telling you if we need to add a new static item then we will only need to modify the Items property.. but we do not want to modify any further formulas not even a formula that will set a variable (which i think it is obvious )...

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @johnjohn123 

    Then we are back to my original point!!

     

    If you have $5, $10, $15, $20, $25 in your Choices definition in your SharePoint list, AND you are allowing write in values.  Then when someone Submits a value of, say, $100, then your Choices definition will become $5, $10, $15, $20, $25, $100.  

    Likewise, if another user submits $200, then your choices will become $5, $10, $15, $20, $25, $100, $200

     

    SO, how do you expect to distinguish the value that was entered as it is NOW part of the standard Choices?  It's not possible as you would never be able to figure that out in any formula.  Unless you are recording that somewhere else in the record, then how could you (looking at the last list of choices above) be able to say "this record's value was $100" or "this record's value was $200"??

     

    I am sorry if you are trying to state something else and I am not following, but this is what I am getting from your descriptions and how things work.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @johnjohn123 

    I should add...

     

    YES, you can make your Radio items dynamic by using Choices(yourDataSource.yourAmountColumn)

    BUT, this still is going to be a problem to decern what the value was that was entered when the fill-in choice was made.

  • johnjohn123 Profile Picture
    3,514 on at

    @RandyHayes  i am sure now that you are not reading my questions carefully... i AM beyond describing if filling-in a choice will affect the radio button options i have ,, as i already mentioned this before...

     

    now i have a Radio button with static choices 5,10,15,20,25 ... my question is how i can get those values and check if the ThisItem.amount is inside those values.. again i am not asking about doing this formula while hard coding those static items choices...

     

    finally,, this formula will not work

     

    Choices(yourDataSource.yourAmountColumn)

     

    because i am DEFINING A STATIC items FOR MY RADIO BUTTON iTEMS AND NOT THE CHOICES FROM SHAREPOINT !!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @johnjohn123 

    But you JUST stated "but I DO NOT WANT TO WRITE STATIC CODE INSIDE MY FORMULAS"

    Now you are stating that you ARE "DEFINING A STATIC items FOR MY RADIO BUTTON iTEMS"

     

    So I am not sure how to help you.  You can't not want to define static but then want to define static.  I am not sure what you are looking for.

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard