cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KevinHardy
Level 8

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
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!

 




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

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"
   }
)




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

9 REPLIES 9
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?




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
KevinHardy
Level 8

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

 

 

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!

 




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

Highlighted
KevinHardy
Level 8

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




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
KevinHardy
Level 8

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

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 🙂




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
KevinHardy
Level 8

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

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"
   }
)




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,422)