DMXzone Server Connect Support Product Page

how to set a value with server connect

Asked 04 Jun 2018 15:59:43
1
has this question
04 Jun 2018 15:59:43 andrea mac posted:
Hi, I need to use the set value step in server connect. Then I need to use that value. Do anyone know how to do this?

Replies

Replied 05 Jun 2018 05:43:21
05 Jun 2018 05:43:21 Greta Garberini replied:
The movie in your head does not apply to the rest of the world.
This is far too little information to get help. Sorry.
Replied 05 Jun 2018 06:22:30
05 Jun 2018 06:22:30 andrea mac replied:
Hi, that's The question.
I have a condition tree like this in an action file:

Step
DB connection
Db query
Step
Condition (if db query.count >1)
Then
Set value
Else
Set value

I want to use The set value to check the result of The conditional structure
and show different messages. The problem is that I can't set The value.
I mean i don't know if i have to create a kind of variable (in server connect set value options there is "global name"
And how to assign that value
Replied 05 Jun 2018 07:00:36
05 Jun 2018 07:00:36 Greta Garberini replied:
OK, so if you want to set a value it needs a variable to associate with. (Don't forget to save your server action)
So, you are correct to assume this.
Then in AppConnect you create a new component where you assign your server action.

Another option is described here:

www.dmxzone.com/go/32809/assigning-dynamic-css-classes-using-dmxzone-app-connect-data-formatter

where you create the condition in appconnect client-side

Hope that helps
Replied 05 Jun 2018 20:49:14
05 Jun 2018 20:49:14 andrea mac replied:
Hi, I've look at the video but I still have the problem.
About your suggestion to create an app connect component I'm sorry but I don't understand. I guess this could be a good way but I miss some details.
Anyway let me explain.
I've already talked about the conditional tree.
I want to know which branch is the end of the process.
To do this I set up different values for different branches.
The problem is that I can't assign these values to a variable.
In the server connect file I've defined a get variable but I'm not sure it's useful for the issue.
May be the solution is in app connect but I don't know how to do this.
My target is to assign the value set up in server connect to a get variable.
So, when a new page is loaded after the server connect file is executed, it's possible to show different messages depending on the value of the get variable.
I hope I was clear.
Thank you
Replied 06 Jun 2018 06:00:34
06 Jun 2018 06:00:34 Teodor Kuduschiev replied:
Hello Andrea
It is not really clear what exactly are you trying to achieve on the page.
As i already explained you in the mail i sent, put what needs to run if the conditions is met in the THEN clause, and put the set value which you want to show on the page in the ELSE step when the condition is not met.

Condition (query has more than 1 record)
THEN > what to do when query has more than 1 record
ELSE > what to do if query does not have more than 1 record


setvalue steps can be used on the page under the server connect component using their names:

serverconnect.data.SETVALUENAME
Replied 06 Jun 2018 06:32:57
06 Jun 2018 06:32:57 andrea mac replied:
Hi,
The conditions run very well.
I only want to show an alert when you try to delete the last admin profile in the database. The last ADMIN profile won't be deleted. In any case you will be redirect to another page. In this page I want to show a message, something like:
"Attention. It isn't possible to delete the selected profile because it's the last admin profile".
Now for doing this I wamt to set a get variable passed from the delete page to this other page.
If the get variable is = true, for example, than show the message.
The problem is I don't know how to set the get variable.
I repeat the conditions run very well. The problem is how to set and pass the get variable at the end of the conditional structure.
I hope I was clear.
Replied 06 Jun 2018 06:40:59
06 Jun 2018 06:40:59 Teodor Kuduschiev replied:
Well then if you want to redirect to another page, just need to use SET STATUS step (not set value) and set an error status like 403.
Then on the page, on the form apply:
Dynamic Events > Onsuccess > Browser > Go To URL > 'yourpage.php'
Dynamic EVents > Onforbidden > Browser > Go To URL > 'yourpage.php?urlparam=true'

And then on yourpage.php define the urlparam under app connect query parameters. Select your alert div > dynamic attributes > show > when > query.urlaparam == "true"
Replied 06 Jun 2018 06:41:22
06 Jun 2018 06:41:22 andrea mac replied:
Please Teo, explain better the last thing, about the set value step.
In the conditional process I've already added a set value step at the end of any branch.
The dialog window in server connect ask for:
Name, global name and value.
I don't know which name and global name to digit.
Then I don't know how to pass this value in an url as get variable.
Replied 06 Jun 2018 06:43:51
06 Jun 2018 06:43:51 Teodor Kuduschiev replied:
Please check my last reply.
Replied 06 Jun 2018 16:58:25
06 Jun 2018 16:58:25 andrea mac replied:
Where ca I find SET STATUS step? I can'f find it in server connect step options
Replied 06 Jun 2018 17:18:30
06 Jun 2018 17:18:30 andrea mac replied:
Anyway, Teodor, let me insist. Try what I've told you. SO we don't waste our time and avoid misunderstanding
Replied 06 Jun 2018 17:29:27
06 Jun 2018 17:29:27 Teodor Kuduschiev replied:
What should that mean:

QuoteTry what I've told you. SO we don't waste our time and avoid misunderstanding

???
In my last reply I explained you exactly what to do. Just follow my instructions.

EDIT: the step I mentioned is SET RESPONSE ... not set status, my bad, sorry!
Replied 06 Jun 2018 18:47:25
06 Jun 2018 18:47:25 andrea mac replied:
Hi Teo, stay relaxed and don't forget I'm the CUSTOMER.
I have a problem and, maybe because my English is not perfect, it's difficult to understand each other. Anyway I can't find the set status option. That's it.
Replied 06 Jun 2018 18:51:59
06 Jun 2018 18:51:59 andrea mac replied:
I'll try to follow your suggestions. About 'don't waste time' I refer to the suggestion to try the page. It's the easiest way and avoids misunderstandings. That's all.
Replied 06 Jun 2018 19:01:10
06 Jun 2018 19:01:10 Teodor Kuduschiev replied:

Reply to this topic