I am trying to load some data from a field into an Action Form via SQL but cannot do it.
Here's what I have so far:
* I have created a table with dummy data called 'dbo.DummyTable' and a dummy field called 'TestData' (there is only 1 field and 1 row at the moment).
* Inserted the SQL query under the events tab >> On Page Load >> Run SQL Query:
SELECT TestData
FROM dbo.DummyTable (eventually I will add a where clause and other conditions once it's working)
I think the Bind Expression might be just to show /hide or enable/disable a field based on conditions but I just want to make an area on the form whether that be a a text box or Dynamic Field to show the TestData field from my database, but nothing is working at the moment. -any ideas? (running DNN v 9.11 and Action Form v 5.21.6)
I think you are better of using Action Grid for this. You can create a list or grid, based on your SQL statement.
The Bind expression is indeed a rule that defines whether a field is shown or not.
If you don't have action grid, you can use 2SXC (free) or Live visualizer (commercial)
thanks, we don't have Action Grid, at least not at the moment. Last time I looked at 2SXC I found it confusing and would rather steer clear of that at the moment if possible. It was suggested that extracting columns might work (under Events >> On Page Load >> Extract Column, and using that as a token but that's not working at the moment either.
think I'm getting closer to a solution using "Create List from SQL" action and "For Each List Entry" , although I still cannot get it working.
Here's what I've got so far, 1. Created an action form with a user text box to retrieve their input > Called "UserTxt" 2. On the submit btn of the form, I've used: "Create List from SQL" 3. on the above SQL Query used - "SELECT MyField FROM dbo.MyDummyTable" 4. Given the list the name 'MyList', 5. ADD >> Execute Actions For Each List Entry, 6. ? some conditions ? 7. Action List >> Display Message >> e.g. 'success message, match found'
I think the issue is around step 6?, perhaps its just a case of formatting the condition under Execute Actions? such as :
[ < MyList> == < UserTxt > ] or [ < MyList > : < MyField > ] == < UserTxt > ]
I have tried formatting the conditions in a variety of ways and even without any conditions but nothing happens either way - the display message is never shown. Am I missing something? or does it look OK, and in which case it might be just a formatting/typo issue?
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.