Assigning Pointer Data For More Rows In Schedule

Assigning Pointer Data For More Rows In Schedule

rajankur6494
Collaborator Collaborator
420 Views
8 Replies
Message 1 of 9

Assigning Pointer Data For More Rows In Schedule

rajankur6494
Collaborator
Collaborator

[ FlexSim 21.0.10 ]

@Matthew Gillespie

I like the way you defined location name in terms of pointer data in schedule table itself.

How to Set Overflow Location Logic Based on Chair Availability? - FlexSim Community

It looks more scalable in this way. But I think I have to use picker for every row after assigning pointer data to cells. It will be much difficult to do it for more number of rows (1000) having multiple location.

What is the best way to do it?

Thank you!

0 Likes
Accepted solutions (1)
421 Views
8 Replies
Replies (8)
Message 2 of 9

moehlmann_fe
Advocate
Advocate
Accepted solution

You don't have to use the picker. If the entered values are all the same or follow a regular pattern, you can copy and paste blocks of previous cells.

copypaste.gif

You can also use code to assign values to the schedule. An example is provided in the script window of the attached model.

As is, the code assigns "RegularChair" to each cell in the fifth column. You could also modify it to assign different values depending on some condition, for example the value in another row.

1651135490812.png

test13-chairs_1.fsm

0 Likes
Message 3 of 9

rajankur6494
Collaborator
Collaborator

Thank you so much @Felix Möhlmann for this piece of code!

Still I would like to ask 1 more question. Actually, there are multiple locations based on provider. Suppose if user want to add provider in existing model, this process looks little bit difficult for new user. Is there any other easy way to do it? I am expecting something in excel and paste directly here that data.

0 Likes
Message 4 of 9

moehlmann_fe
Advocate
Advocate

Values pasted from excel will automatically interpreted as either a string (text) or a number. You can paste in the name of the object and then run code (similar to before) to find the correct object and replace the name with a pointer. This could also be done as part of the "Post Import Code" if you set up an automatic excel import.

copypastepointer.gif

Alternatively yoiu can leave the value in the soure as text and replace the token label with a pointer in the arrivals flow before creating the patient.

1651146629730.png

test13-chairs_2.fsm

0 Likes
Message 5 of 9

rajankur6494
Collaborator
Collaborator

Thank you so much! @Felix Möhlmann

I really like the second approach of doing it. But I have 1 question here if I may ask.

If we have two location with respect to chair label "regular_chair", let say "regular_chair_MD" for MD, "regular_chair_clerk" for clerk. So, is there any way to join suffix in the label "regular_chair" and get the chair pointer to access these locations?

test13-chairs3.fsm

0 Likes
Message 6 of 9

rajankur6494
Collaborator
Collaborator

I got it. Thank you for you support! @Felix Möhlmann

0 Likes
Message 7 of 9

moehlmann_fe
Advocate
Advocate
Happy to hear that you figured it out. Just for completeness sake, in case other users are searching for the same question:

You can simply add strings together with a "+" operator. So if "token.chair" is "regular_chair" and "token.MD" is "MD", then

Model.find(token.chair + "_" + token.MD) 

would search for the object named "regular_chair_MD".

0 Likes
Message 8 of 9

rajankur6494
Collaborator
Collaborator
@Felix Möhlmann

I want to change my label name "Chair" based on whatever is acquired from overflow location (randomly picked). While clicking on token, I can see that pointer data "/Chair6" is allocated in locations label field. But I only want to assign "Chair6" to my Chair label.

Is there any way to do it?

Thank you!

0 Likes
Message 9 of 9

moehlmann_fe
Advocate
Advocate

"object.name" returns the name of the object. So the following would assign the name of the last acquired location to the Chair label.

1651303758683.png

0 Likes