cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ferran1
Level: Powered On

Visitor Registration and Badge Assignment

I have created an APP to act as our visitor registration. I have it mostly completed, but now am adding in additional features that would be nice. It is just an EditForm that will update a sharepoint list. One of the inputs is a Radio button selection of what type of visit that doing (applicant, meeting, vendor). We already have generic ID badges that we give to these type of users, A001, A002..., M001, M002...,V001,V002...

 

Is it possible when they click the submit button to not only Submit the form, but then also have it run something like this (written logically and not in any kind of code):

 

If Radio = X then update database column badge number with a value from Numbers1 and remove that value from selection

If Radio = Y then update database column badge number with a value from Numbers2 and remove that value from selection

If Radio = Z then update dtaabase column badge number with a value from numbers3 and remove that value from selection

 

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Visitor Registration and Badge Assignment

There are a few ways you could do it but here is one option:

 

On your Radio Button that lets them select the reason for visiting put OnChange as:

 

Set(varReason, If(Radio1.Selected.Value="Applying for job","Job", Radio1.Selected.Value="Meeting","Meeting", Radio1.Selected.Value="Vendor","Vendor"))

 

Also on your existing form you need to add a column for the Badge Number that is being used by them (you can hide this card, just ones less thing to patch) and make the default of it be: Gallery1.Selected.Title  <--This being the name of the Gallery that is showing the collection.

 

** This setting a variable for the Type and then you would need a column on your Badge list for this also **

 

For the button that looks like Submit to the User put the OnSelect as:

 

ClearCollect(CollBadge, First(Filter(SPBadgeList, BadgeType=varReason && Status="Available")));

UpdateContext({showConfirm:true})

 

Then have a small gallery (you can make it not look like a gallery but just having a simple text and button field or something).

Visible=showConfirm

Items=CollBadge

 

For that Gallery I would personally put something that shows the Badge number and asks them to confirm or something like that and a button that says Confirm. You could also make this look like its just a Confirmation and have it pop a message asking them click to confirm...whatever you want to do here but you need a button in the gallery that has the OnSelect as:

 

SubmitForm(FormName);Patch(SPBadgeList, ThisItem, {Status:"Unavailable"});Navigate(ScreenHome,Cover)

 

So here is an explanation for all those in just regular terms:

 

* When they select the reason they are there you are setting a variable that is selecting the "Type" of visit from your Badge list.

* When they click the "Submit" button they are creating a collection of one item that is the first item in the Badge List that has an "Available" status and has the "Reason" the same as they selected...you are also then making the Confirm Gallery show

* When they click the button in the Gallery they are Selecting that Badge which is putting that badge number on that person but it is also updating the status of that badge to "Unavailable" so it can't be used until they leave....and then it is just taking you home or something.

 

I know it may sound a little confusing but if you play around with it you will see it isn't really that complicated. Hope this helps!

 

 

View solution in original post

11 REPLIES 11
Community Support Team
Community Support Team

Re: Visitor Registration and Badge Assignment

Hi @ferran1 ,

Do you want to update the form with related badge number based on the selection of the radio button?

Is badge number field decided by the selection of the radio button and increasing based on the same type  badge number?

If so, you could try this formula:

Set(var,Radio1.Selected.Value);SubmitForm(Form1);
If(var="X",
Patch(listname,Form1.LastSubmit,
{badge number:Concatenate("A",Right(
                                     Text(
                                          Right(
                     Last(Sort(Filter(listname,A in badge number),badge number)).badge number,
                                                 3)+1,
                                          "[$-en-US]00#"
                                          ),
                                     3)
                           )
}   ),
var="Y",
Patch(listname,Form1.LastSubmit,
{badge number:Concatenate("M",Right(
                                     Text(
                                          Right(
                     Last(Sort(Filter(listname,M in badge number),badge number)).badge number,
                                                 3)+1,
                                          "[$-en-US]00#"
                                          ),
                                     3)
                           )
}   ),    
var="Z",
Patch(listname,Form1.LastSubmit,
{badge number:Concatenate("V",Right(
                                     Text(
                                          Right(
                     Last(Sort(Filter(listname,V in badge number),badge number)).badge number,
                                                 3)+1,
                                          "[$-en-US]00#"
                                          ),
                                     3)
                           )
}   )
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ferran1
Level: Powered On

Re: Visitor Registration and Badge Assignment

yea, sort of. I don't think I fully explained my desire.

 

We have badges for the 3 types of visitors we usually have. Job Applicant, Vendor, and Visitor. 

 

We have pre-made badges created already for each type that go Visitor 1-10, Applicant 1-10, and Vendor 1-10.

 

When a Job Applicant fills out the form the idea would be that they would be assigned Applicant1. 

 

If another job applicant fills out the form, then they would be assigned Applicant2.

 

When they leave they would signout and then their corresponding badge would be release back into the pool and would be available for the next person. 

 

I am thinking that I need a second sharepoint list that contains these badges. I created that with 2 columns. BadgeNumber and Availability. The idea being, that If badgenumber availability is "locked" that it would choose the next badge number in the list. 

 

Is something like this possible?

Super User
Super User

Re: Visitor Registration and Badge Assignment

You could have a separate SharePoint list for the badges and just one line item for each badge and maybe a column for the type, a column for the badge number and then a status that changes when you check in, and again when they check out. When a person goes to Check in it looks for the next item in line on your list for the badges that has the "Type" they selected and assigns it to them and stores that badger number with their name, then when they check back out it updates the badge number back to a status that is available. 

 

I'm not sure if I explained this well...sometimes my mind just runs..lol. 

ferran1
Level: Powered On

Re: Visitor Registration and Badge Assignment

@rebeccas yea, that is what I am looking for. How would I have it look for the next line that has an "unlocked" status?

Super User
Super User

Re: Visitor Registration and Badge Assignment

Just off the top of my head I am thinking when they put in their data it gives them a gallery that is filtered for the badges available with that same "Type" whith the top number at the top (just by sorting that way). Most likely they will automatically select the first item in the gallery and just have it patch those two pieces of information when they click on that badge number (from the gallery).

 

BUT...If you wanted to lock it down where they have no way to PICK a badge number and it just has one choice. You could get that information by using First and put into a collection. So...They put in their details and click a button that does:

 

ClearCollect(CollBadgeNum, First(Filter(BadgeList, Reason="Visitor")))

 

Then your gallery that they click on the badge number will just have one item in it if you set the items to CollBadgeNum. That second click would then be what changes the status of that badge and assigns that badge number to that person. They wouldn't have to KNOW they are clicking twice, you could make that second click appear as a "Confirmation" to them. 

 

That second gallery click would just Patch that item for the badge and Patch the first list (the persons check in) to reflect that Badge Number. The reason you want to save that badge number in a column for that person is for when they check out so it will change that back to being an available badge. 

 

A few ways you could do it but something like that would work pretty smooth I think. 

ferran1
Level: Powered On

Re: Visitor Registration and Badge Assignment

@rebeccas  Ok, I am sort of following what you are saying. Will I need to redo my current form, or is it something we would just be able to pass through on the "OnSelect" property of my button? Attached is a screen shot of my "EditForm". Right now, the Sign In button just is OnSelect=SubmitForm(EditForm); Navigate('Successful Checkin', None);

Super User
Super User

Re: Visitor Registration and Badge Assignment

There are a few ways you could do it but here is one option:

 

On your Radio Button that lets them select the reason for visiting put OnChange as:

 

Set(varReason, If(Radio1.Selected.Value="Applying for job","Job", Radio1.Selected.Value="Meeting","Meeting", Radio1.Selected.Value="Vendor","Vendor"))

 

Also on your existing form you need to add a column for the Badge Number that is being used by them (you can hide this card, just ones less thing to patch) and make the default of it be: Gallery1.Selected.Title  <--This being the name of the Gallery that is showing the collection.

 

** This setting a variable for the Type and then you would need a column on your Badge list for this also **

 

For the button that looks like Submit to the User put the OnSelect as:

 

ClearCollect(CollBadge, First(Filter(SPBadgeList, BadgeType=varReason && Status="Available")));

UpdateContext({showConfirm:true})

 

Then have a small gallery (you can make it not look like a gallery but just having a simple text and button field or something).

Visible=showConfirm

Items=CollBadge

 

For that Gallery I would personally put something that shows the Badge number and asks them to confirm or something like that and a button that says Confirm. You could also make this look like its just a Confirmation and have it pop a message asking them click to confirm...whatever you want to do here but you need a button in the gallery that has the OnSelect as:

 

SubmitForm(FormName);Patch(SPBadgeList, ThisItem, {Status:"Unavailable"});Navigate(ScreenHome,Cover)

 

So here is an explanation for all those in just regular terms:

 

* When they select the reason they are there you are setting a variable that is selecting the "Type" of visit from your Badge list.

* When they click the "Submit" button they are creating a collection of one item that is the first item in the Badge List that has an "Available" status and has the "Reason" the same as they selected...you are also then making the Confirm Gallery show

* When they click the button in the Gallery they are Selecting that Badge which is putting that badge number on that person but it is also updating the status of that badge to "Unavailable" so it can't be used until they leave....and then it is just taking you home or something.

 

I know it may sound a little confusing but if you play around with it you will see it isn't really that complicated. Hope this helps!

 

 

View solution in original post

ferran1
Level: Powered On

Re: Visitor Registration and Badge Assignment

@rebeccas That was Perfect! A few adjustments for my environment and it is working great!

 

Thank you so much!

ferran1
Level: Powered On

Re: Visitor Registration and Badge Assignment

@rebeccas  So I got the whole part of checking the badge out down, formatted and functioning how I'd like it. On the checking the badge back in (setting the badge availability to unlocked) it only wants to the do the top row of the list.

 

I have a gallery that lists all Visitors that are currently visiting. It is pulling that data from my Visitors sharepoint list. The button then runs a couple of commands. Since my Badges is a separate list I am trying to set a variable of varBadgeID using the selected boxes badge number from the visitors list, and then editing the corresponding field in the guest badges sharepoint list for whichever badge number is varBadgeID. Hopefully that makes sense, here is the code for the OnSelect of my "trashcan button".

 


 

UpdateContext({isloading:true}); 
Set(varBadgeID,Gallery3.Selected.'Badge Number');
UpdateContext({EditRecord:Patch(Visitors,LookUp(Visitors,ID=Gallery3.Selected.ID),{Chk_OUT_TIME: Now()},{Status:"CheckedOut"})});
UpdateContext({EditRecord:Patch(GuestBadges,LookUp(GuestBadges,BadgeNumber=varBadgeID),{Availability:"unlocked"})});
UpdateContext({isloading:false}); 
Navigate('Successful Checkout', ScreenTransition.None)​

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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