How is your experience with the OutSystems Community?
Post Closed
15
Views
3
Comments
Solved by AI
External Library Integration in ODC

I have created class library which have one interface and one class. It have two methods one return string other number which is received in input. I have tested it its working fine on .NET but when i publish them and import as library in demo app, then after using method as server action the hardcoded output of getName() method is also getting blank 

2023-12-26 10-35-28
OutSystems Neo
Staff
Solution by AI
AI Generated

What you’re seeing is a known “optimization” behavior when calling server logic (server actions / extensions) from a Client Action in Reactive / ODC applications.

OutSystems only evaluates the result of a server call if at least one of its outputs is effectively used in something that affects the UI or further logic. If the output of your getName() method (or the server action that wraps it) isn’t used in a way that OutSystems considers “needed”, the platform skips returning it, and you’ll see it as blank in the client action debugger, even though the method executed correctly on the server. This is the same behavior described in the articles you provided for both static entity defaults and extension calls. Data Loss from server action to callback function

What to check

  1. How you call the library method

    • Typically you’ll have:
      • An extension (C# class library) with a method getName() → exposed as an action.
      • A Server Action (or Service Action) that calls this extension method and outputs a Text parameter.
      • A Client Action calling that Server/Service Action.
  2. Whether the output is actually used

    • After calling the server action in the client action, ensure you:
      • Assign the output to a screen/local variable that is bound to the UI (Expression, Text widget, etc.), or
      • Use it in a Feedback Message, validation, IF condition, or any other node that is rendered/evaluated.
    • If you only assign it to some local variable that is never used anywhere, OutSystems may optimize it away and you’ll see empty values.
  3. Testing that the output is really there

    • Add a Feedback_Message right after the server action:
      • Message = YourServerActionName.Out_Name
    • Or place YourLocalVariable (to which you assign the output) in an Expression on the screen just for testing.
    • You should now see the hardcoded getName() string show up correctly.
  • Wrap the extension call in a Service Action (preferred) or Server Action.
  • Ensure at least one output:
    • Is returned from that Service/Server Action.
    • Is truly used in the client side flow/UI.
  • If you ever see “blank outputs” from extension actions in reactive:

If after binding the result to the UI or using it in a feedback message you still get an empty value, describe how your client action is structured (where you assign / use the result), and I can suggest a more precise fix.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2023-09-06 07-26-35
Sudip Pal

Hi @shreyans wadyalkar 

Is there any interface present in your .NET code?

Thanks,

Sudip

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

@shreyans wadyalkar please refrein from double posting the same question. 

I will close this post, the discussion can continue at https://www.outsystems.com/forums/discussion/106375/external-library-integration-in-odc/ 

2023-12-26 10-35-28
OutSystems Neo
Staff
Solution by AI
AI Generated

What you’re seeing is a known “optimization” behavior when calling server logic (server actions / extensions) from a Client Action in Reactive / ODC applications.

OutSystems only evaluates the result of a server call if at least one of its outputs is effectively used in something that affects the UI or further logic. If the output of your getName() method (or the server action that wraps it) isn’t used in a way that OutSystems considers “needed”, the platform skips returning it, and you’ll see it as blank in the client action debugger, even though the method executed correctly on the server. This is the same behavior described in the articles you provided for both static entity defaults and extension calls. Data Loss from server action to callback function

What to check

  1. How you call the library method

    • Typically you’ll have:
      • An extension (C# class library) with a method getName() → exposed as an action.
      • A Server Action (or Service Action) that calls this extension method and outputs a Text parameter.
      • A Client Action calling that Server/Service Action.
  2. Whether the output is actually used

    • After calling the server action in the client action, ensure you:
      • Assign the output to a screen/local variable that is bound to the UI (Expression, Text widget, etc.), or
      • Use it in a Feedback Message, validation, IF condition, or any other node that is rendered/evaluated.
    • If you only assign it to some local variable that is never used anywhere, OutSystems may optimize it away and you’ll see empty values.
  3. Testing that the output is really there

    • Add a Feedback_Message right after the server action:
      • Message = YourServerActionName.Out_Name
    • Or place YourLocalVariable (to which you assign the output) in an Expression on the screen just for testing.
    • You should now see the hardcoded getName() string show up correctly.
  • Wrap the extension call in a Service Action (preferred) or Server Action.
  • Ensure at least one output:
    • Is returned from that Service/Server Action.
    • Is truly used in the client side flow/UI.
  • If you ever see “blank outputs” from extension actions in reactive:

If after binding the result to the UI or using it in a feedback message you still get an empty value, describe how your client action is structured (where you assign / use the result), and I can suggest a more precise fix.

This answer was AI-generated. Please read it carefully and use the forums for clarifications