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 / If parent.default is b...
Power Apps
Answered

If parent.default is blank, get value from elsewhere

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I'm trying to work out this is possible: if the parent.default value is blank, take the value from a slider (which can then be saved), otherwise show the default value. I'd do the opposite on the slider, show the value if it's pre-existing otherwise set to a particular value.


Tried this but.... 

Lauren__0-1616060187806.png

If(IsBlank(Parent.Default),Slider1,Parent.Default)

(it accepts it without the parent.default at the end)

Categories:
  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @Anonymous 

    That should be possible. Where are you applying this formula? Is it on the Update property of a card?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Coalesce(Parent.Default, Slider1)

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

    @Anonymous 

    You will need, however, to specify the Value property of the slider in your formula:

        Coalesce(Parent.Default, Slider1.Value)

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @RandyHayes 

    As an aside, it is interesting that you can put a label's Text property or a  Textinputbox's Default as simply Slider1 and even do arithmetic functions and the correct value will be displayed, but inside a function like Coalesce()  you need to specify .Value 

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

    @Drrickryp 

    True, but here is the rub...you should ALWAYS refer to the property you want.  For some reason, the designer is VERY forgiving about not doing that.  However, the Players (especially on the iPhone) are NOT forgiving and this is the source of many "My app works in the designer, but...." questions.

    The reason Coalesce expects it is because it is very concerned over the type of the items it is coalescing.  In the formula:  Coalesce(Parent.Default, Slider)  It is specifically coalescing over a numeric value and a control object...it will not do that.

    Personally, I wish the designer was more strict and the players less.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Developers-vs-users.jpg

     

  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    @RandyHayes - The thing that confuses me is that the error says that it's expecting a control value, and that text is an invalid argument type.

    It makes me think that the formula is attached to the wrong property (ie, something other than Update property, which is where I'd expect to this formula to be).

    I agree that your formula is the correct answer here, but I'm struggling to make sense of the error message in the screen shot! Can you see what I might be misunderstanding here?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Coalesce(TextInput1.Text*1, Slider1.Value) will convert the textinput to a number that can be compared with the slider value. 

     

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

    @timl 

    Actually, it is misleading because the first condition of the If is a control.  Therefore, the error is saying that (the dark underlined part) it should be a control type as well.  Which is correct.  In the context of the If, you must return the same types for the true and false part.

    The formula editor has already determined that you are trying to return a control (i.e the Slider) and thus is complaining that now you are trying to return text. 

     

    @Drrickryp  Although that shortcut sometimes works...a lot of the time these are things that the Player will not respect.  The designer will, but not the player.  It is always safer to go with the function that is designed to convert to a value...Value

    Thus : Coalesce(Value(TextInput1.Text), Slider1.Value) is a safer formula.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey folks, thanks for the responses!

     

    So I've tried Coalesce(Parent.Default*1, Slider1.Value), however this doesn't quite behave how I wanted, maybe I need to expand on what's happening here/what I'm aiming for it to do.

     

    I'm using a slider to give a score of 0-5. The default value on the slider is 2.5 (basically just so it's in the middle). The slider will populate a field on a form which will be saved into SharePoint.

     

    There is a potential that I could filter this information from this gallery once saved it's no longer visible on the gallery with the sliders, but I'm aiming for it can be saved and retained on the same gallery, so the slider/field on the form knows when to have default 2.5 or the saved information from the item on the form. Does that make sense?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard