cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Default text if dropdown is empty

Hi all,

Screenshot attached.

I have a dropdown 'Morning Staff Name' which looks up the persons email address from our Office365. This is a required field.

Below this is a text entry box for 'Other Staff/Agency Name' - not a required field.

What I am trying to do is:

If 'Other Staff/Agency Name' is not blank (i.e. the user has entered a name), then 'Morning Staff Name' should = 'agency@email.org.uk' (for example) to stop an error when submitting the form.

I'v been trying <>"" and !IsBlank combinations but the proper syntax escapes me.

Help please 🙂

Kev

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Default text if dropdown is empty

oh wow 😺 +1 for the autism crowd as I'm autistic too!

 

Ok, right so it's looking for a record, so we just need to create a record that matches the column or value it's looking for,

so we generate a record by using record format:

{ nameofThing : "valueOfThing"}

 

which may look something like this:

 

If(
   !IsBlank(DataCardValue12.Text)

   ,
   {
       Value: "agency.worker@autismhampshire.org.uk"
   }
)

 

Value here might be the column name depending on how your combobox is done, could you give that a try in your DefaultSelectedItems rather than Default as well, sorry about the confusion earlier!

 


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Super User
Super User

Re: Default text if dropdown is empty

Whoops, that's a typo on my part!

 

If you aren't already I would also take a look at all of the guidance for App Makers online, then spotting stuff like this becomes a lot quicker 😺

 

If(
   !IsBlank(DataCardValue12.Text) && IsBlank(DataCardValue1.Selected.Text)

   ,
   {
       Value"agency.worker@autismhampshire.org.uk"
   }
)


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

9 REPLIES 9
Highlighted
Super User
Super User

Re: Default text if dropdown is empty

Heya!

 

Within the Default/DefaultSelectedItems for the first one:

If(
    !IsBlank(NameOfOtherStaffAgencyNameControl.Text),
    "agency@email.org.uk"
)

 

however, if this is a people picker, that account needs to exist! so do you have a generic account it can use?


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted
Resolver I
Resolver I

Re: Default text if dropdown is empty

Hi @iAm_ManCat 

 

If I understand you correctly, the Default property of DataCardValue1 (Morning staff name) = 

If(!IsBlank(DataCardValue12.Text),"agency.worker@autismhampshire.org.uk")

DataCardValue12 is the Other staff/agency name field.  The email address for agency.worker does exist.

However, this returns an error:

  Capture1.PNG

 

 

Highlighted
Super User
Super User

Re: Default text if dropdown is empty

oh wow 😺 +1 for the autism crowd as I'm autistic too!

 

Ok, right so it's looking for a record, so we just need to create a record that matches the column or value it's looking for,

so we generate a record by using record format:

{ nameofThing : "valueOfThing"}

 

which may look something like this:

 

If(
   !IsBlank(DataCardValue12.Text)

   ,
   {
       Value: "agency.worker@autismhampshire.org.uk"
   }
)

 

Value here might be the column name depending on how your combobox is done, could you give that a try in your DefaultSelectedItems rather than Default as well, sorry about the confusion earlier!

 


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Resolver I
Resolver I

Re: Default text if dropdown is empty

Hi @iAm_ManCat , that worked first time in DefaultSelected Items!! Brilliant. Thank you so much 🙂

I think it's a nice sin chronicity that you are autistic - I work for a charity that supports autistic adults in small residential settings. The apps will replace all the paper records we currently have to keep. But there are dozens of them so it will take me a long time to do 🙂

I have some experience as a web designer several years ago using Dreamweaver and Adobe Flash, so have a basic understanding of HTML, Javascipt, and Visual Basic. So quite often I know what I need to happen but the actual syntax of the formula escapes me.

Thank you again for your help.

 

Kev

Super User
Super User

Re: Default text if dropdown is empty

Happy to help!

 

haha yeah don't get me started on forms, we have so many that I never even put them into the backlog, instead focusing on the Core Apps for now - If I could go back and start from scratch again though, I would definitely have started with the quick wins like forms!

 

Cheers,
Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted
Resolver I
Resolver I

Re: Default text if dropdown is empty

Hi @iAm_ManCat , I have an addendum to this formula if possible.

When implementing it I discovered I need to cover another eventuality. Occasionally we have two members of staff supporting one individual. You can select more than one name in 'Staff Name' look-up which is fine. The issue of course is if it is contracted member of staff plus an agency staff.

At present I can put my name in 'Staff Name', but when I put the agency name in it overwrites my name with 'agency.worker' etc.

I really need it to keep whatever has been inputted into staff name if it isn't blank.

 

Kev

Highlighted
Super User
Super User

Re: Default text if dropdown is empty

Ok,

 

So I'm thinking something along the lines of:

 

If(
   !IsBlank(DataCardValue12.Text) && (IsBlankDataCardValue1.Selected.Text)

   ,
   {
       Value"agency.worker@autismhampshire.org.uk"
   }
)

 

and I'm not sure about the bit in Red, as might be looking for Email or something else instead, so could you type the '.' and let Intellisense do the rest 🙂


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted
Resolver I
Resolver I

Re: Default text if dropdown is empty

Hi @iAm_ManCat ,

 

It doesn't like any variation and wasn't even offering any possibles. 

 

Screenshot 2019-11-27 at 11.55.09.png

Highlighted
Super User
Super User

Re: Default text if dropdown is empty

Whoops, that's a typo on my part!

 

If you aren't already I would also take a look at all of the guidance for App Makers online, then spotting stuff like this becomes a lot quicker 😺

 

If(
   !IsBlank(DataCardValue12.Text) && IsBlank(DataCardValue1.Selected.Text)

   ,
   {
       Value"agency.worker@autismhampshire.org.uk"
   }
)


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,021)