# Assignment message including variable value

**URL:** <https://forum.universal-robots.com/t/assignment-message-including-variable-value/13512>\
**Category:** General Application Help: How do I?\
**Created:** [April 9, 2021, 2:37am UTC](https://forum.universal-robots.com/t/assignment-message-including-variable-value/13512 "2021-04-09T02:37:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew2](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew2](https://forum.universal-robots.com/u/andrew2)\
**Post date:** [April 9, 2021, 2:37am UTC](https://forum.universal-robots.com/t/assignment-message-including-variable-value/13512/1 "2021-04-09T02:37:04Z")

</div>

Hi, is there a way to have the text shown from an Operator Message in an Operator Assignment display the value of a variable?

Eg The current position is “5” continue? Yes/No Assignment where the value 5 is being obatined from a variables current value.

Or is their a URScript that could acheive the same/similiar? I have found a script for a popup displaying a variable but really need it in an assignment so the operator can make a decision based on the current value.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [April 9, 2021, 6:29am UTC](https://forum.universal-robots.com/t/assignment-message-including-variable-value/13512/2 "2021-04-09T06:29:21Z")

</div>

Hi @andrew2

Welcome to the UR forum!

Yes. you can have a text that show the value of a variable.  
The script function _to\_str()_ will do the job of converting the value to a string. You can then use _str\_cat()_ to compose the complete string for your message and pass it to the _request\_boolean\_from\_primary\_client()_ function.

Your concrete sample is put toghether here:

```python
value = 5
operator_bool = request_boolean_from_primary_client(str_cat("The current position is '", str_cat(to_str(value), "' continue?")))

```

Ebbe

---

<div class="post-metadata">

**Author:** ![andrew2](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew2](https://forum.universal-robots.com/u/andrew2)\
**Post date:** [April 12, 2021, 2:37am UTC](https://forum.universal-robots.com/t/assignment-message-including-variable-value/13512/3 "2021-04-12T02:37:22Z")

</div>

Fantastic, just what I was looking for, Thanks Ebbe!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/system/32/1_2.png) [@system](https://forum.universal-robots.com/u/system)\
**Post date:** [April 14, 2021, 2:37am UTC](https://forum.universal-robots.com/t/assignment-message-including-variable-value/13512/4 "2021-04-14T02:37:41Z")

</div>

Closed on April 14, 2021, 2:37am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
