Question

Photo of Richard Sanford

0

Populate single select type attribute with SQL query values...

trying to set a workflow attribute value in a form from a Run SQL action...I've got a single select attribute and action #1 is to run a SQL Query to return some location values and put them in the Result Attribute. Action #2 is to open the User Entry Form and at this point I would like to see the sql results in the single select attribute i created and filled with the sql results...but it's not showing any values. If I change the attribute to just a text type I will the the first sql result in the attribute so I know the SQL and the actions are correct. I tried changing the SQL query to return the results as a single row with the values comma delimited into a single select type but that doesn't work. How can i get the single select type drop down to populate???


Thanks

  • Photo of Richard Sanford

    0

    ok well I got it solved with help from Eddie Holeman at Fellowship Greenville...didn't realize I had to use ID as value and NAME as text for the drop down list...see below..the location and attribute IDs are just for testing purposes...


    select
      Loc.[ID] AS [Value],
      Loc.[Name] AS [Text]
    from
       [Location] Loc
    inner join
      [AttributeValue] AV on Loc.[id] = AV.[EntityId]
    where
       Loc.[ParentLocationId] = 68
          and AV.[AttributeId] = 3852