Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Populating floating field with a variable

Avatar

Avatar
Validate 1
Level 2
marcink-lwR9iu
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
marcink-lwR9iu
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
marcink-lwR9iu
Level 2

03-09-2018

I have a floating field called: FF_Name. Can I use a varialble with the same name to populate that field? Or do I have to use FF_Name.rawValue?

I this: I have a global variable called: myVar. Somewhere down in my hierarchy I have a floating field called: myVar. My expectation was, the floating field will be changed to the value of myVar. But that didn't work. I had to rename the floating field (myFloatingField) and in the initialize event i had to:

this.myFloatingField.value = myVar;

That worked, but i'd rather avoid using code for this thing

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

03-09-2018

Hi,

There is another option, if you are willing to edit the XML Source of your form.

When you insert a floating field Designer will insert a bit of xHTML in your text object that looks something like;

<span xfa:embedType="uri" xfa:embedMode="raw" xfa:embed="#floatingField016841"/>

The "floatingField016841" bit is a reference to the hidden field containing the value to insert.

You can also have xHTML that references a SOM expression, so in your case assuming your form is called form1

<span xfa:embedType="som" xfa:embedMode="raw" xfa:embed="form1.myVar"/

Will insert your global variable.

Saves the having the hidden field

Bruce

Answers (3)

Answers (3)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

04-09-2018

Hi Marcin,

It scared me for a while, but sometimes it was the only so did get comfortable with it.

There is a macro facility within Designer, so you could get around it that way.

Regards

Bruce

Avatar

Avatar
Validate 1
Level 2
marcink-lwR9iu
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
marcink-lwR9iu
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
marcink-lwR9iu
Level 2

04-09-2018

Hey Bruce

Yes, that answers my question - but I was hoping on doing it without having to change the xml.

We work in a bigger team, and not all people are having a coding background and are kind of, how to put it, reluctant on editing the xml sources...

Thanks!

Marcin

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

03-09-2018

Hi,

I wrote a bit here about Global Variables: How to compare global variable value to TextField value

I would expect you might be able to use the same name, but you will need to specifically reference it.

this.resolveNode("myVar.rawValue") = global.myVar; //global is the name of your script object.